/***************************************************************
|	File:		DestroyEntityMessage.cpp
|	Author:		Doug Monroe
|	Course:		SGD
|	Purpose:	DestroyEntityMessage class stores the entity to
|				remove from the Entity Manager
***************************************************************/

#include "DestroyEntityMessage.h"

#include "Entity.h"
#include "MessageID.h"
#include <cassert>


/**************************************************************/
// CONSTRUCTOR
//	- hold a reference to the entity parameter
DestroyEntityMessage::DestroyEntityMessage( Entity* pEntity )
: Message( MessageID::MSG_DESTROY_ENTITY )
{
	// Validate the parameter
	assert( pEntity != nullptr 
			&& "DestroyEntityMessage - parameter cannot be null" );


	// Store the entity
	m_pEntity = pEntity;
	m_pEntity->AddRef();
}


/**************************************************************/
// DESTRUCTOR
//	- release the reference to the entity member
DestroyEntityMessage::~DestroyEntityMessage( )
{
	// Release the entity
	m_pEntity->Release();
	m_pEntity = nullptr;
}
